echo off
setlocal EnableDelayedExpansion
cd %~dp0
@REM if exist "..\include\flashData.h" (
@REM     echo ..\include\flashData.h already exists
@REM     echo cover flashData.h? [y/n]
@REM     set /p answer=
@REM     if not "!answer!"=="y" (
@REM         exit
@REM     )
@REM )

xxd -i -n flashData ..\res\long_flash.bin > ..\include\long_flashData.h
if %errorlevel% neq 0 (
    echo create flashData.h failed[%errorlevel%]
) else (
    echo create flashData.h success
)

xxd -i -n eepData ..\res\long_eeprom.bin > ..\include\long_eepData.h
if %errorlevel% neq 0 (
    echo create flashData.h failed[%errorlevel%]
) else (
    echo create flashData.h success
)

xxd -i -n flashData ..\res\short_flash.bin > ..\include\short_flashData.h
if %errorlevel% neq 0 (
    echo create flashData.h failed[%errorlevel%]
) else (
    echo create flashData.h success
)

xxd -i -n eepData ..\res\short_eeprom.bin > ..\include\short_eepData.h
if %errorlevel% neq 0 (
    echo create flashData.h failed[%errorlevel%]
) else (
    echo create flashData.h success
)